struct ListNode* createlist()
{
    int number;

    struct ListNode* head = NULL;

    while (1)
    {
        scanf("%d", &number);
        if (number == -1) break;

        struct ListNode* newnode = (struct ListNode*)malloc(sizeof(struct ListNode));
        //push front
        newnode->data = number;
        newnode->next = head;
        head = newnode;
    }

    return head;
}